package com.pf.business.converter;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.converters.WriteConverterContext;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.pf.business.enums.CriteriaTypeEnum;

/**
 * @author PanFei
 * @version 1.0.0
 * @createTime 2023/7/16 13:42
 */
public class CriteriaTypeConverter implements Converter<Integer> {

    @Override
    public WriteCellData<?> convertToExcelData(WriteConverterContext<Integer> context) throws Exception {
        String message = CriteriaTypeEnum.getMessageByCode(context.getValue());
        return new WriteCellData<>(message);
    }
}
